package com.pri.chat.adapter;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.netease.nim.uikit.net.entity.RechargeBondBean;
import com.pri.chat.R;

import java.util.List;

import androidx.annotation.Nullable;

/**
 * 描述：添加类的描述
 *
 * @author wx5e48d604c2885118
 * @time 2020/4/23
 */
public class RechargeListAdapter extends BaseQuickAdapter<RechargeBondBean, BaseViewHolder> {
    public RechargeListAdapter(int layoutResId, @Nullable List<RechargeBondBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RechargeBondBean item) {
        View monthRelation = helper.getView(R.id.monthRelation);
        ImageView monthImg = helper.getView(R.id.monthImg);
        TextView goldNumberTv = helper.getView(R.id.goldNumber);
        goldNumberTv.setText(item.getGoldNumber()+"");
        TextView priceTv = helper.getView(R.id.price);
        priceTv.setText(item.getMoney()+"元");
        if(item.isCheck()){
            monthImg.setVisibility(View.VISIBLE);
            monthRelation.setBackgroundResource(R.drawable.btn_orange_noconer_line_shape);
            goldNumberTv.setTextColor(mContext.getResources().getColor(R.color.orange));
            priceTv.setTextColor(mContext.getResources().getColor(R.color.orange));
        }else{
            monthImg.setVisibility(View.GONE);
            monthRelation.setBackgroundResource(R.drawable.btn_gray_noconer_line_shape);
            goldNumberTv.setTextColor(mContext.getResources().getColor(R.color.color_666666));
            priceTv.setTextColor(mContext.getResources().getColor(R.color.color_666666));
        }
    }
}
